<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>数据对象模板管理</title>
    <link rel="stylesheet" href="../../../assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../../assets/module/dtree/dtree.css"/>
    <link rel="stylesheet" href="../../../assets/module/dtree/font/dtreefont.css"/>
    <link rel="stylesheet" href="../../../assets/libs/ztree/css/zTreeStyle/zTreeStyle.css">
    <link rel="stylesheet" href="../../../assets/module/admin.css?v=313"/>
    <link rel="stylesheet" href="../../../assets/css/publicStyle.css"/>
    <link rel="stylesheet" href="../../../assets/css/micro/template.css"/>

    <!--[if lt IE 9]>
    <script src="../../../assets/libs/html5shiv.min.js"></script>
    <script src="../../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <script src="../../../assets/libs/template-web.js"></script>
    <style>
        #template-iden-tmpl-box .layui-btn+.layui-btn {
            margin-left: 5px;
        }
        #addIdenManageForm .title{
            padding: 5px 15px 5px 0;
            font-size: 14px;
            line-height: 1.5;
        }
        #addIdenManageForm .model-form-body{
            padding: 0;
        }
        .layui-layer.layui-layer-adminRight{
            top: 14px !important;
        }
        .copyIdentModel{
            padding: 15px;
        }
        .layui-layer-setwin .layui-layer-close2{
            right: 14px!important;
            top: -5px!important;
            width: 30px!important;
            height: 30px!important;
        }
        #downloadDataSelect{
            display: none;
        }
        #uploadDataBtn{
            margin-left:15px;
        }
        .excelDataUploadModel{
            padding: 15px;
        }
        .excelDataUploadModel .subtext{
            font-size:12px;
        }
        .excelDataUploadModel .layui-input-block p{
            line-height: 2;
            font-size: 14px;
        }
        .oracleDataUploadModel .delete-btn{
            margin-left:15px;
        }
        .oracleDataUploadModel .text-left{
            margin-top: 20px;
        }
        #dataPreviewModel{
            display: none;
        }
        #dataPreviewTmplBox{
            margin-left: 15px;
        }
        #cmIden-box{
            width: 100%;
            height: 100px;
            padding: 0 20px;
            overflow-x: hidden;
            overflow-y: auto;
        }
        #pmIden-box{
            width: 100%;
            height: 100px;
            padding: 0 20px;
            overflow-x: hidden;
            overflow-y: auto;
        }
        .tips{
            font-size: 14px;
            color: #666666;
            text-align: center;
        }
        #treeTbTree{
            padding: 0;
        }
        #idenManagePageMoreFilterModel .layui-form-item .layui-form-label{
            width: 85px;
         }
        #setMasterSlaveClassForm .layui-table-box .layui-btn-xs{
            height: 20px!important;
        }
        #editIdenManageForm,#addIdenManageForm{
            padding: 25px 30px 25px 0;
        }
    </style>
</head>
<body>

<!-- 加载动画 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <!-- 左表 -->
        <div class=" layui-col-sm12 layui-col-md2 layui-col-lg2">
            <div class="layui-card">
                <div class="layui-card-header">明细对象目录</div>
                <div class="layui-card-body" >
                    <div id="template-iden-tmpl-box"></div>
                    <ul id="treeTbTree" class="ztree" ></ul>
                </div>
            </div>
        </div>
        <!-- 右树 -->
        <div class="layui-col-sm12 layui-col-md10 layui-col-lg10">
            <div class="layui-card">
                <div class="layui-card-header">明细数据表管理</div>
                <div class="layui-card-body mini-bar" >
                    <div id="template-idenManage-tmpl-box"></div>
                    <div id="page-box"></div>
                    <table class="layui-table" id="identGroupTable" lay-filter="identGroupTable" lay-skin="nob"></table>
                    <!-- 更多筛选条件弹窗 -->
                    <div class="" id="idenMoreFilterModel">
                        <fieldset class="layui-elem-field layui-field-title" >
                            <legend>数据表更多筛选</legend>
                        </fieldset>
                        <form id="idenMoreFilterForm" lay-filter="idenMoreFilterForm" class="layui-form model-form ">
                            <input name="userId" type="hidden"/>
                            <div class="layui-form-item">
                                <label class="layui-form-label">明细对象表名</label>
                                <div class="layui-input-block">
                                    <input name="name" placeholder="请输入对象表名" type="text" class="layui-input" maxlength="20"
                                           lay-verType="tips" lay-verify="" />
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">报告期类型</label>
                                <div class="layui-input-block">
                                    <select name="report_type" id="report-type" placeholder="全部">
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">明细对象类型</label>
                                <div class="layui-input-block">
                                    <select name="meta_type" id="micro-type" placeholder="全部">
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item text-left">
                                <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" id="closeIdenMoreFilterModel">取消</button>
                                <button class="layui-btn layui-btn-sm" lay-filter="idenMoreFilterForm" lay-submit >搜索</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--渲染数据表分类-->
<script type="text/tmpl" id="template-microType-tmpl">
    <option value="">全部</option>
     {{each microData}}
        <option value="{{$value.value}}">{{$value.meta_type}}</option>
    {{/each}}

</script>
<!--渲染报告期类型-->
<script type="text/tmpl" id="template-reportType-tmpl">
    <option value="">全部</option>
     {{each reportData}}
        <option value="{{$value.value}}">{{$value.report_type}}</option>
    {{/each}}

</script>
<style>
    .masterTable{
        width: 400px;
        height: 400px;
        float: left;
        overflow-x: hidden;
        overflow-y: auto;
        margin-left: 38px;
        padding: 20px 0;
    }
    .fromTable{
        width: 400px;
        height: 400px;
        float: right;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 20px 0;
    }
    .setformTable{
        clear: both;
    }
    .setformTable a{
        line-height: inherit !important;
    }
    .check_tr{
        background: #c1c1c1;
    }
</style>
<!-- 设置主从表弹窗 -->
<script type="text/html" id="setMasterSlaveClassModel">
    <form id="setMasterSlaveClassForm" lay-filter="versionGroupForm" class="layui-form layui-row model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">设置主表</label>
            <div class="layui-input-block">
                <select name="parid" placeholder="请选择" id="pmIden" lay-filter="pmIden">

                </select>
            </div>
        </div>
        <div class="setformTable">
            <div class="masterTable">
                <p>主表指标</p>
                <table class="layui-table" id="master_table" lay-filter="master_table" lay-skin="nob"></table>
            </div>
            <div class="fromTable">
                <p>从表指标</p>
                <table class="layui-table" id="form_table" lay-filter="form_table" lay-skin="nob"></table>
            </div>
        </div>
        <div class="layui-form-item text-right ">
            <button class="layui-btn layui-btn-primary layui-btn-sm" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn layui-btn-sm" lay-filter="setPmIden" lay-submit>确定</button>
        </div>
    </form>

</script>
<!--渲染对象分类-->
<script type="text/tmpl" id="template-pmIden-tmpl">
    <option value="">请选择</option>
     {{each pmIdenLis}}
        <option value="{{$value.id}}">{{$value.name}}</option>
    {{/each}}

</script>
<!--渲染对象分类-->
<script type="text/tmpl" id="template-cmIden-tmpl">
     {{each pmIdenMicro}}
        <input type="checkbox" class="cm_iden" name="cmIden" value="{{$value.idenCode}}" title="{{$value.idenName}}" lay-skin="primary">
    {{/each}}

</script>
<!-- 主表表格操作 -->
<script id="ident-master-tpl-box">
</script>
<!-- 表格操作列 -->
<script type="text/tmpl" id="ident-master-tmp">
    <a class="layui-btn layui-btn-danger layui-btn-xs micro-ident-group-delete" lay-event="delete">删除</a>
</script>
<script id="ident-form-tpl-box">
</script>
<!-- 表格操作列 -->
<script type="text/tmpl" id="ident-form-tmp">
<a class="layui-btn layui-btn-xs layui-btn-primary " lay-event="confirm" >确认</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs micro-ident-group-delete" lay-event="delete">删除</a>
</script>
<!--渲染对象分类-->
<script type="text/tmpl" id="template-pmIdemlist-tmpl">
     {{each pmIdenMicro}}
        <input type="checkbox" class="pm_iden" name="pmIden" value="{{$value.idenCode}}" title="{{$value.idenName}}" lay-skin="primary">
    {{/each}}

</script>
<!--渲染数据表权限-->
<script type="text/tmpl" id="template-idenManage-tmpl">
    <div class="layui-form toolbar">
        <div class="layui-form-item">
            <div class="layui-inline">
                {{ if hasPower("/micro/microMeta/index-class:queryList")}}
                <div class="layui-input-inline mr0">
                    <input name="keyword" class="layui-input layui-input-sm" type="text" placeholder="输入关键字"/>
                </div>
                {{/if}}
            </div>
            <div class="layui-inline">
                {{ if hasPower("/micro/microMeta/index-class:queryList")}}
                <button class="layui-btn icon-btn layui-btn-sm" lay-filter="formSubSearchTbLtrt" lay-submit>
                    <i class="layui-icon">&#xe615;</i>搜索
                </button>
                {{/if}}
                {{ if hasPower("/micro/microMeta/index-class:queryList")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="morefilter-btn-idenManage" >
                    …   更多筛选
                </button>
                {{/if}}
                {{ if hasPower("/micro/microMeta/index-class:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="add-btn-template-idenManage" >
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                {{/if}}
            </div>
        </div>
    </div>
  </script>

<!-- 分组表格操作列DOM -->
<script id="ident-template-idenManage-box">
</script>
<!-- 数据表管理表格操作列 -->
<script type="text/tmpl" id="ident-template-idenManage-tmp">
    {{ if hasPower("/micro/microMeta/index-class:edit")}}
    <a class="layui-btn layui-btn-xs layui-btn-warning" lay-event="edit">编辑</a>
    {{/if}}
    {{ if hasPower("/micro/microMeta/index-class:iden")}}
    <a class="layui-btn layui-btn-xs layui-btn-primary " lay-event="idenManage">指标管理</a>
    {{/if}}
    {{ if hasPower("/micro/microMeta/index-class:data")}}
    <a class="layui-btn layui-btn-xs layui-btn-primary " lay-event="dataManage">数据管理</a>
    {{/if}}
    {{ if hasPower("/micro/microMeta/index-class:masterSlaveClass")}}
    <a class="layui-btn layui-btn-xs layui-btn-primary " lay-event="setMasterSlaveClass">设置主从表</a>
    {{/if}}
    {{ if hasPower("/micro/microMeta/index-class:menu")}}
    <a class="layui-btn layui-btn-xs layui-btn-primary " lay-event="setCatalog">设置目录</a>
    {{/if}}
    {{ if hasPower("/micro/microMeta/index-class:delete")}}
    <a class="layui-btn layui-btn-danger layui-btn-xs micro-ident-group-delete" lay-event="delete">删除</a>
    {{/if}}
</script>

<!--渲染对象目录模板权限-->
<script type="text/tmpl" id="template-iden-tmpl">
     <div class="layui-form toolbar">
        <div class="layui-form-item">
            <div class="layui-inline">
                 <div class="layui-inline">
                {{if hasPower("/micro/microMeta/index-menu:add")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="addTemplateIdenBtn">
                    <i class="layui-icon">&#xe654;</i>新增
                </button>
                {{/if}}
                {{if hasPower("/micro/microMeta/index-menu:edit")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="editTemplateIdenBtn">
                    <i class="layui-icon">&#xe642;</i>编辑
                </button>
                {{/if}}
                {{if hasPower("/micro/microMeta/index-menu:delete")}}
                <button class="layui-btn icon-btn layui-btn-sm" id="deleteTemplateIdenBtn">
                    <i class="layui-icon">&#xe640;</i>删除
                </button>
                {{/if}}
                </div>
            </div>
        </div>
     </div>
</script>

<!-- js部分 -->
<script type="text/javascript" src="../../../assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="../../../assets/js/common.js?v=313"></script>
<script src="../../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
<!-- Ztree树部分 -->
<script src="../../../assets/libs/ztree/js/jquery.ztree.core.min.js"></script>
<script src="../../../assets/libs/ztree/js/jquery.ztree.exedit.js"></script>
<script src="../../../assets/libs/ztree/js/jquery.ztree.excheck.min.js"></script>
<script src="../../../assets/libs/copy/clipboard.min.js"></script>

<script src="../../../assets/libs/template-web.js"></script>
<script src="../../../assets/libs/axios.min.js"></script>
<script src="../../../assets/js/config.js"></script>
<script src="../../../assets/js/authority.js"></script>

<script src="../../../assets/js/micro/microMeta/index.js"></script>

</body>

</html>